package a.f.m;

import a.c.q;
import a.f.o;
import a.f.rc;

import java.util.ArrayList;
import java.util.List;

public class b
  implements rc
{
  private List e = new ArrayList();
  public static boolean f;
  
  public void a(a.d.w paramw, double paramDouble1, double paramDouble2, double paramDouble3)
  {
    this.e.add(new a_(paramw, paramDouble1, paramDouble2, paramDouble3));
  }
  
  public void a(a.d.w paramw, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    this.e.add(new b_(paramw, paramDouble1, paramDouble2, paramDouble3, paramDouble4));
  }
  
  public boolean canLayout(o paramo)
  {
    return true;
  }
  
  public void doLayout(o paramo)
  {
    int k = a.N;
    int j = a.M;
    Point2D.Double localDouble = new Point2D.Double();
    a.c.w localw = paramo.v();
    if (localw.e())
    {
      localDouble.x = paramo.m(localw.d());
      localDouble.y = paramo.n(localw.d());
    }
    label148:
    label150:
    while (k != 0)
    {
      int i = 0;
      if (i < this.e.size()) {}
      do
      {
        c_ localc_ = (c_)this.e.get(i);
        localc_.a(localDouble);
        i++;
        if (k != 0) {
          break label150;
        }
        if (j != 0) {
          break label148;
        }
        if (j == 0) {
          break;
        }
        paramo.a(localw.d(), localDouble.x, localDouble.y);
      } while (k != 0);
      localw.f();
      if (j == 0) {
        break;
      }
    }
  }
  
  public static final void a(o paramo, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5)
  {
    a(paramo, new a_(new a.d.w(paramDouble1, paramDouble2), paramDouble3, paramDouble4, paramDouble5));
  }
  
  public static final void a(o paramo, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, double paramDouble6)
  {
    a(paramo, new b_(new a.d.w(paramDouble1, paramDouble2), paramDouble3, paramDouble4, paramDouble5, paramDouble6));
  }
  
  public static final void a(o paramo, c_ paramc_)
  {
    int j = a.N;
    int i = a.M;
    Point2D.Double localDouble = new Point2D.Double();
    do
    {
      a.c.w localw = paramo.v();
      while (i == 0)
      {
        if (!localw.e()) {
          break;
        }
        localDouble.x = paramo.m(localw.d());
        localDouble.y = paramo.n(localw.d());
        paramc_.a(localDouble);
        paramo.a(localw.d(), localDouble.x, localDouble.y);
        localw.f();
      }
    } while (j != 0);
  }
  
  private static final class b_
    implements b.c_
  {
    private a.d.w a;
    private double b;
    private double c;
    private double d;
    private double e;
    private double f;
    private double g;
    
    public b_(a.d.w paramw, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      this.a = paramw;
      this.c = paramDouble1;
      this.d = paramDouble2;
      this.b = paramDouble3;
      this.e = paramDouble4;
      this.f = ((paramDouble4 - 1.0D) / (2.0D * (paramDouble2 - paramDouble1)));
      this.g = (paramDouble4 * paramDouble2 - this.f * (paramDouble2 - paramDouble1) * (paramDouble2 - paramDouble1));
    }
    
    public void a(Point2D.Double paramDouble)
    {
      int j = a.N;
      int i = a.M;
      double d1 = paramDouble.x - this.a.a;
      double d2 = paramDouble.y - this.a.b;
      double d3 = Math.abs(d1);
      if (j == 0) {
        if (d3 == 0.0D) {
          return;
        }
      }
      if (j == 0) {
        if (d3 < this.c)
        {
          d4 = d3 * this.e;
          if (j == 0) {
            if (i == 0) {
              break label159;
            }
          }
        }
        else
        {
          if (j != 0) {
            break label156;
          }
        }
      }
      if (d3 < this.d)
      {
        if (j != 0) {
          break label157;
        }
        d4 = d3 * this.e - (d3 - this.c) * (d3 - this.c) * this.f;
        if (i == 0) {
          break label159;
        }
      }
      label156:
      label157:
      double d4 = this.g + d3 - this.d;
      label159:
      if (j == 0) {}
      paramDouble.x = (this.a.a + (d1 > 0.0D ? d4 : -d4));
      d3 = Math.abs(d2) * this.b;
      if (j == 0) {
        if (d3 < this.c)
        {
          d4 = d3 * this.e;
          if (j == 0) {
            if (i == 0) {
              break label305;
            }
          }
        }
        else
        {
          if (j != 0) {
            break label302;
          }
        }
      }
      if (d3 < this.d)
      {
        if (j != 0) {
          break label303;
        }
        d4 = d3 * this.e - (d3 - this.c) * (d3 - this.c) * this.f;
        if (i == 0) {
          break label305;
        }
      }
      label302:
      label303:
      d4 = this.g + d3 - this.d;
      label305:
      if (j == 0) {}
      paramDouble.y = (this.a.b + (d2 > 0.0D ? d4 : -d4));
    }
  }
  
  private static final class a_
    implements b.c_
  {
    private a.d.w a;
    private double b;
    private double c;
    private double d;
    private double e;
    private double f;
    private double g;
    
    public a_(a.d.w paramw, double paramDouble1, double paramDouble2, double paramDouble3)
    {
      this(paramw, paramDouble1, paramDouble2, 1.0D, paramDouble3);
    }
    
    public a_(a.d.w paramw, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      this.a = paramw;
      this.b = paramDouble1;
      this.c = paramDouble2;
      this.d = paramDouble4;
      this.g = paramDouble3;
      this.e = ((paramDouble4 - 1.0D) / (2.0D * (paramDouble2 - paramDouble1)));
      this.f = (paramDouble4 * paramDouble2 - this.e * (paramDouble2 - paramDouble1) * (paramDouble2 - paramDouble1));
      if (j == 0)
      {
        if (q.n) {
          i++;
        }
      }
      else {
        a.M = i;
      }
      if (q.o)
      {
        j++;
        a.N = j;
      }
    }
    
    public void a(Point2D.Double paramDouble)
    {
      int j = a.N;
      int i = a.M;
      double d1 = paramDouble.x - this.a.a;
      double d2 = (paramDouble.y - this.a.b) / this.g;
      double d3 = Math.sqrt(d1 * d1 + d2 * d2);
      if (j == 0) {
        if (d3 == 0.0D) {
          return;
        }
      }
      if (j == 0)
      {
        if (d3 < this.b)
        {
          d4 = d3 * this.d;
          if (j != 0) {
            return;
          }
          if (i == 0) {
            break label172;
          }
        }
        if (j != 0) {}
      }
      else if (d3 < this.c)
      {
        d4 = d3 * this.d - (d3 - this.b) * (d3 - this.b) * this.e;
        if (j != 0) {
          return;
        }
        if (i == 0) {
          break label172;
        }
      }
      double d4 = this.f + d3 - this.c;
      label172:
      paramDouble.x = (this.a.a + d1 * d4 / d3);
      paramDouble.y = (this.a.b + this.g * d2 * d4 / d3);
    }
  }
  
  public static abstract interface c_
  {
    public abstract void a(Point2D.Double paramDouble);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.m.b

 * JD-Core Version:    0.7.0.1

 */